import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

import application.model.Simulator;

public class ApplicationGUI extends JFrame implements ActionListener
{	
	private static final long serialVersionUID = 1L;
	private JButton btnStepOne;
	private JButton btnStepHundred;
	private Simulator simulator;
	
	public static void main(String [] args)
	{
		new ApplicationGUI();
		
	}

	public ApplicationGUI()
	{
		simulator = new Simulator();
		btnStepOne = new JButton("One Step");
		
		GridLayout layout = new GridLayout(0,2);	
		this.setLayout(layout);
		
		this.add(btnStepOne);
		btnStepOne.addActionListener(this);
		this.setVisible(true);
	}

	@Override
	public void actionPerformed(ActionEvent e) 
	{		
		if(e.getSource().equals(this.btnStepOne))
		{	
			simulator.simulateOneStep();
			System.out.println("Step 1 button clicked");
		}
		else if(e.getSource().equals(this.btnStepHundred))
		{
			simulator.simulate(100);
			System.out.println("Step Hundred button clicked");
		}
	}
}
